package com.gugee.ins.common.dal.mapper.media;

import com.gugee.common.mapper.GugeeMapper;
import com.gugee.ins.common.model.mysql.media.InsRelMediaCaptionTag;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * InsRelMediaCaptionTagMapper
 * @author Huangxin
 */
public interface InsRelMediaCaptionTagMapper extends GugeeMapper<InsRelMediaCaptionTag> {

    /**
     * 根据uid 获取标题文本标记的内容话题
     * @param uid
     * @return
     */
    @Select("select t2.shortcode, t2.caption_tag from (select shortcode from ins_media where owner_uid = #{uid}) t1 " +
            "inner join ins_rel_media_caption_tag t2 " +
            "on t1.shortcode = t2.shortcode ")
    List<InsRelMediaCaptionTag> findCaptionTagByUid(long uid);
}